package task;

public class Task3_8 {
    public static void main(String[] args) {
        for (int i = 2; i < 1000; i++) {
            int a = i;
            int sum = 0;
            while(a > 0){
                int s= a % 10;
                sum = sum + ((int)(Math.pow(s,3)));
                a /= 10;
            }
            if(sum == i){
                System.out.println(i);
            }

        }
    }
}
